<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta id="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
		<meta name="apple-themes-web-app-capable" content="yes">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<meta content="telephone=no" name="format-detection">
		<meta content="email=no" name="format-detection">
		<meta name="format-detection" content="telephone=no">
		<title>地址管理</title>	
		<link rel="stylesheet" href="${s.base}/mobile/css/main.css" type="text/css" media="all">
	</head>
	<style type="text/css">
    	.wq_list ul li{padding-left:0px; border-top:0px;   border-bottom: 1px dashed #d3d3d3;}
		.wq_list ul h2 span{margin-right:5px;}
		#header .header_con .right_div div{ line-height:0.80rem;
		padding-bottom:0.08rem;
	font-size:0.7rem;
	color:#FFF;
	margin-right:0.2rem;
   }
    </style>
	<body>  
		<header id="header">
			<div class="header_con">
				<a href="${s.base}/phone/home?memberId=${memberId}"><span></span></a>
                <div class="top_tit">地址管理</div>    
                <div class="right_div"><div onclick="window.location.href='${s.base}/phone/addressUpdate?memberId=${memberId}&id='">+</div></div>
			</div>
		</header>
        <#if  list?? && (list?size > 0)>
		<div id="content_div" >
            <div class="wq_list">
                <#list list as address>
                    <ul>
                        <li>
                            <p><span>联系人</span>${address.name}</p>
                            <p><span>手机号</span>${address.phone}</p>
                            <p><span>地址</span> ${address.province}${address.city}${address.area}</p>
                        </li>
                        <h2 style="color:#F00;">
                            &nbsp;
                            <#if address.type=='1'>
                                默认地址
                            </#if>
                            <span onclick="window.location.href='${s.base}/phone/addressUpdate?memberId=${memberId}&id=${address.id}'">编辑</span><span onclick="del('${address.id}','${address.name}')">删除</span></h2>
                    </ul>
                </#list>
           </div>
      </div>
            <#else>
                <div class="yy_jl_no">
                    <i></i>
                    <p>您还没有添加地址哦！</p>
                    <a onclick="window.location.href='${s.base}/phone/addressUpdate?memberId=${memberId}&id='">立即添加</a>
                </div>
        </#if>
            <!--底部-->
			<!--底部结束-->
		   
           <script type="text/javascript" src="${s.base}/mobile/js/jquery.min.js"></script>
		  <script type="text/javascript" src="${s.base}/mobile/js/common.js"></script>
        <script type="text/javascript" src="${s.base}/js/layer/layer.js"></script>
        <script type="text/javascript" src="${s.base}/js/base/commont.js"></script>
        <script type="text/javascript">
            /**
             * 删除
             */
            function del(id,name) {
                var memberId = '${memberId}';
                layer.confirm('是否删除联系人为【'+name+'】的地址？',{icon:3, title:'提示信息'},function(index){
                    $.ajax({
                        type: "GET",
                        url: "/phone/address/delEntity/"+id+"?memberId="+memberId,
                        success: function(result){
                            if(1==result.returnInfo.state){
                                showLayerAlertNoRefre("删除成功");
                            }else{
                                showLayerAlertNoRefre(result.returnInfo.errorMsg);
                            }
                        },
                        error: function(result){
                            showLayerAlertNoRefre(result);
                        }
                    });
                });

            }

        </script>
	</body>

</html>